home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / tpasextr.arc / VIDEO.DOC < prev   
Encoding:
Text File  |  1986-11-22  |  84.6 KB  |  2,374 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.       TURBO ENHANCEMENT TOOLKIT DOCUMENTATION
  15.  
  16.                 User-Supported Software
  17.  
  18.  
  19.                 Programmer's Utilities
  20.  
  21.                           by
  22.  
  23.                       Kevin Dahl
  24.  
  25.                      1711 4th St N
  26.              Wahpeton, North Dakota  58075
  27.  
  28.  
  29.              Version 2.00 - December 1986
  30.  
  31.           (C) Copyright 1986 by Kevin W. Dahl
  32. ..page
  33. ..foot48Ri
  34.                     INTRODUCTION
  35.  
  36. This product is hereby released to the public domain
  37. for personal, non-commercial use only.  Any feedback
  38. will be appreciated.
  39.  
  40.                         NOTICE:
  41.  
  42. A limited license is granted to all users of these
  43. routines, to make copies of these routines and
  44. distribute them to other users, on the following
  45. conditions:
  46.    1. The routines are not to be distributed to others
  47.       in modified form.
  48.    2. No fee is to be charged for copying or
  49.       distributing these routines without an express  -
  50.       written agreement with the author, Kevin W. Dahl,
  51.       Copyright (C) 1986
  52.  
  53. The number of global type and variable declarations
  54. have been kept to a minimum, so most of these routines
  55. do not require any global declarations. You will find
  56. the routines included here work primarily with the
  57. video display screen.
  58.  
  59. While these procedures and functions work only with the
  60. video display I hope to add more procedures and
  61. functions to this library that work with other areas of
  62. the PC.  Your comments and suggestions on how to
  63. improve and extend the usefulness of this library will
  64. be appreciated.
  65.  
  66. I hope these routines make your programming efforts
  67. easier and more enjoyable.
  68.                                             Kevin
  69.  
  70.  
  71.  
  72.  
  73.  
  74. Turbo Pascal is a trademark of Borland International
  75. ..page
  76. ..foot48Rii
  77. =============== User-Supported Software ===============
  78.  
  79.  
  80.  If you have received these routines from another user
  81.     and find them to be of value, your contribution
  82.              will be greatly appreciated.
  83.  
  84.                 ( $10.00 suggested ).
  85.  
  86.  
  87.             ------------------------------
  88.  
  89.                      Kevin W. Dahl
  90.                      1711 4th St N
  91.                   Wahpeton, ND  58075
  92.  
  93.             ------------------------------
  94.  
  95.  Regardless of whether you make a contribution, you are
  96.    encouraged to copy and distribute these routines.
  97.  
  98. =======================================================
  99.  
  100. The user-supported concept:
  101.  
  102. Anyone may request a copy of a user-supported program
  103. by sending a blank, formatted disk to the author of the
  104. program.  An addressed, postage-paid return mailer must
  105. accompany the disk (no exceptions, please).
  106.  
  107. A copy of the program, with documentation, will be sent
  108. by return mail. The program will carry a notice
  109. suggesting a contribution to the program's author.
  110. Making a contribution is completely voluntary on the
  111. part of the user.
  112.  
  113. Regardless of whether a contribution is made, the user
  114. is encouraged to copy and share the program with
  115. others.  Payment for use is discretionary on the part
  116. of each subsequent user.
  117. ..page
  118. ..foot48Riii
  119.       FUTURE ENHANCEMENTS AND UPDATE POLICY:
  120.  
  121. These routines are being distributed under the user-
  122. supported concept and will only be improved if you make
  123. suggestions for improvements and enhancements you would
  124. like to see.
  125.  
  126. Provided users support these routines, the following
  127. will apply.  Any time there are revisions or updates to
  128. the routines all Registered Owners will be notified.
  129.  
  130. Help all public domain contributors by sending your
  131. contribution for the programs and routines you find
  132. useful.
  133.  
  134. If users find these routines of use and send their
  135. contributions to me, I will add more procedures and
  136. functions to this library.
  137.  
  138. *** NOTE ***
  139.  
  140. The current source code for all of these routines has
  141. been written using the Microsoft Macro Assembler
  142. Version 4.0.  Some of the routines can be assembled,
  143. because of the assembler directives available, and used
  144. with Microsoft Pascal.  If you are a registered user
  145. you may obtain a copy of the source code by sending a
  146. check for $35.00, unregistered $50.00, to:
  147.  
  148.     Kevin Dahl
  149.     1711 4th St N
  150.     Wahpeton, ND  58075
  151.     (701) 642-2445
  152. ..page
  153. ..foot48Riv
  154.                    Table of Contents
  155.  
  156.     CHAPTER 1
  157.        System Requirements ......................  1-1
  158.        File Requirements ........................  1-1
  159.  
  160.     CHAPTER 2 - VIDEO PROCEDURES AND FUNCTIONS
  161.  
  162.        BoarderColor .............................  2-1
  163.        ClrWin ...................................  2-2
  164.        ColorMsg .................................  2-3
  165.        EditSt ...................................  2-4
  166.        FillCol ..................................  2-9
  167.        FillColAttr ..............................  2-10
  168.        FillRow ..................................  2-11
  169.        FillRowAttr ..............................  2-12
  170.        FrameWin .................................  2-13
  171.        GetCursorSize ............................  2-15
  172.        GetScrn ..................................  2-16
  173.        GetVideoMode .............................  2-18
  174.        GotoXYAbs ................................  2-19
  175.        InitVideo ................................  2-20
  176.        PutScrn ..................................  2-21
  177.        RvsVideo .................................  2-23
  178.        ScrollDn .................................  2-24
  179.        ScrollLeft ...............................  2-26
  180.        ScrollUp .................................  2-28
  181.        ScrollRight ..............................  2-30
  182.        SetCursorSize ............................  2-32
  183.        WaitMsg ..................................  2-33
  184.        WhereXAbs ................................  2-35
  185.        WhereYAbs ................................  2-36
  186.        WriteSt ..................................  2-37
  187.        WriteStLn ................................  2-38
  188.  
  189.     CHAPTER 3 - KEYBOARD PROCEDURES AND FUNCTIONS
  190.  
  191.        ClrKbd ...................................  3-1
  192.        GetKbdElmt ...............................  3-2
  193.        KbdStatus ................................  3-3
  194.        ReadKbd ..................................  3-4
  195. ..page
  196. ..foot48Rv
  197.     APPENDIX A
  198.        Summary of Procedures and Functions ......  A-1
  199.  
  200.     APPENDIX B
  201.        Keyboard codes ...........................  B-1
  202.  
  203.     APPENDIX C
  204.        Keyboard element codes ...................  C-1
  205.  
  206.     APPENDIX D
  207.        Keyboard return codes ....................  D-1
  208.  
  209.     APPENDIX E
  210.        Keyboard scan codes ......................  E-1
  211. ..page
  212. ..pgno01
  213. ..foot48R1-##
  214.                   SYSTEM REQUIREMENT:
  215.  
  216.     IBM-PC or true compatible
  217.     64k RAM
  218.     1 disk drive
  219.     DOS 2.0 or greater
  220.     Turbo Pascal 3.0 or greater
  221.  
  222.                    FILE REQUIREMENTS
  223.  
  224.     Since these external routines are written in
  225.     assembly language the assembled modules are
  226.     included on the disk.
  227.  
  228.     Only the routines you use in your programs must be
  229.     on the disk during compliation of your program.  To
  230.     determine which external routine must be on your
  231.     disk refer to the Filename listed in the
  232.     documentation on the procedure you are using.  For
  233.     example, if you were using the procedure RvsVideo,
  234.     then the file V15.ENH must be on your disk and you
  235.     would also need the procedure declaration:
  236.  
  237.           Procedure RvsVideo;       External 'V15.ENH'
  238.  
  239.     at the beginning of your source code in your
  240.     program.
  241. ..page
  242.              NOTATION ON VIDEO COORDINATES
  243.  
  244. I decided to include this section on video coordinates
  245. because of the consistencies or inconsistencies of the
  246. notation used in describing the (x,y) or (row,col)
  247. coordinates of the video screen. The basic programming
  248. manuals I have looked through describe the screen text
  249. coordinates as (row,col) coordinates where row is a
  250. value from 1 to 25 and col is a value from 1 to 40 or
  251. 80 depending on the screen width.  Notice the row is
  252. presented first. If you have noticed, most word
  253. processors also use this in the form of (line,column)
  254. notation.  In the pascal books that I have read the
  255. text coordinates are described as (x,y) coordinates
  256. where x is a value from 1 to 40 or 80 and y is a value
  257. from 1 to 25.  Notice here the column number of the
  258. (row,col) notation is presented first.  They are the
  259. reverse of each other.
  260.  
  261. Since these routines are written mainly for use with
  262. Turbo Pascal and the screen coordinates are described
  263. as (x,y) coordinates I have decided to use the (x,y)
  264. coordinate notation.  References are also made to rows
  265. and columns.  In these cases row has the meaning of a
  266. value from 1 to 25 and column has a value from 1 to 80.
  267. In order to use the (x,y) and (row,column) notation
  268. interchangeably the following is true:
  269.  
  270.       (x,y) = (col,row)
  271.  
  272. since x and col both refer to the values 1 to 40 or 80
  273. depending on screen width, and y and row both refer to
  274. the values 1 to 25.
  275.  
  276. If it's confusing just think about the regular
  277. mathematical notation used in describing the (x,y)
  278. coordinates on an (x,y) graph in the fourth quadrant
  279. where y is always evaluated as a positive value instead
  280. of a negative value.
  281. ..page
  282. ..pgno01
  283. ..head03RBOARDERCOLOR
  284. ..head04RProcedure
  285. ..head05L_______________________________________________________
  286. ..foot48R2-##
  287. Purpose  :  Sets the color for the boarder screen.
  288.  
  289. Versions :  2.00   3.00    3.01B
  290.              **     **      **
  291.  
  292. Filename :  V1.ENH
  293.  
  294. Format   :  BoarderColor(Color);
  295.  
  296. Remarks  :  Color        is an integer in the range 0
  297.                          to 15.  It is the color for
  298.                          the border screen.
  299.  
  300.             The following colors are allowed for the
  301.             boarder color if you have a Color/Graphics
  302.             Monitor Adapter.
  303.  
  304.             0  Black         8  Gray
  305.             1  Blue          9  Light Blue
  306.             2  Green        10  Light Green
  307.             3  Cyan         11  Light Cyan
  308.             4  Red          12  Light Red
  309.             5  Magenta      13  Light Magenta
  310.             6  Brown        14  Yellow
  311.             7  White        15  High-intensity White
  312.  
  313.  
  314. Example  :  BoarderColor(1);
  315.  
  316.             BoarderColor will display a blue boarder on
  317.             a color monitor.
  318.  
  319. Note     :  BoarderColor does not have any effect on
  320.             a monochrome monitor.
  321.  
  322. ..page
  323. ..head03RCLRWIN
  324. ..head04RProcedure
  325. ..head05L_______________________________________________________
  326. Purpose  :  Clears the current window area.
  327.  
  328. Versions :  2.00   3.00    3.01B
  329.                     **      **
  330.  
  331. Filename :  V2.ENH
  332.  
  333. Format   :  ClrWin;
  334.  
  335. Remarks  :  This procedure will blank the window area
  336.             that is currently defined by Turbo Pascal.
  337.             ClrWin will use the text color and the text
  338.             background color that is currently defined
  339.             by Turbo Pascal as the color to use for the
  340.             window area. ClrWin does not affect the
  341.             position of the cursor.
  342.  
  343. Example  :  Window(5,5,40,20);
  344.             TextColor(Black);
  345.             TextBackGround(Blue);
  346.             ClrWin;
  347.  
  348.             After the window size is define and the
  349.             foreground and background colors are set
  350.             ClrWin will clear the defines window and a
  351.             blue background color will be displayed on
  352.             a color monitor.
  353. ..page
  354. ..head03RCOLORMSG
  355. ..head04RProcedure
  356. ..head05L_______________________________________________________
  357. Purpose  :  Display a message to the screen using the
  358.             color attribute specified.
  359.  
  360. Versions :  2.00   3.00    3.01B
  361.              **     **      **
  362.  
  363. Filename :  V3.ENH
  364.  
  365. Format   :  ColorMsg(X,Y,Attr,Message)
  366.  
  367. Remarks  :  X            is an integer in the range 1
  368.                          to 40 or 1 to 80, depending
  369.                          upon the screen width.  It
  370.                          gives the absolute column
  371.                          on the screen.
  372.  
  373.             Y            is an integer in the range 1
  374.                          to 25.  It gives the absolute
  375.                          row on the screen.
  376.  
  377.             Attr         is an integer in the range 0
  378.                          to 255.  It gives the
  379.                          attribute color to be used for
  380.                          displaying the message.
  381.  
  382.             Message      is any string expression.
  383.  
  384.             ColorMsg is NOT sensitive to Turbo's
  385.             currently defined window and will wrap
  386.             around to column one on the next line of
  387.             the screen when necessary.
  388.  
  389.             ColorMsg will not scroll the screen if the
  390.             data to be displayed is to extend beyond
  391.             the last row of the screen.
  392.  
  393. Special Note :  ColorMsg requires the following global
  394.                 type definition:
  395.  
  396.                 Str255 = String[255];
  397. ..page
  398. ..head03REDITST
  399. ..head04RProcedure
  400. ..head05L_______________________________________________________
  401. Purpose  :  Edit an existing or null string from the
  402.             keyboard.
  403.  
  404. Versions :  2.00   3.00    3.01B
  405.              **     **      **
  406.  
  407. Filename :  V26.ENH
  408.  
  409. Format   :  EditSt(Y,StartX,StopX,Len,CM,
  410.                    VCSet,TCSet,TE,St    );
  411.  
  412. Remarks  :  Y            is an integer in the range 1
  413.                          to 25.  It gives the absolute
  414.                          row on the screen for the
  415.                          string to be editted on.
  416.  
  417.             StartX       is the first column on the row
  418.                          that is used for the edit
  419.                          string.
  420.  
  421.             StopX        is the last column on the row
  422.                          that can be used for the edit
  423.                          string.
  424.  
  425.             Len          is an integer in the range 1
  426.                          to 255.  It gives the maximum
  427.                          length of the string to be
  428.                          editted from the keyboard.
  429.  
  430.             CM           is an integer in the range of
  431.                          1 to 3.  The Case Mode
  432.                          indicator determines how a
  433.                          character is displayed on the
  434.                          screen.
  435.                             1 = Both case.
  436.                             2 = Upper case only
  437.                             3 = Lower case only
  438.  
  439.             VCSet        is the set of valid characters
  440.                          that will be accepted for data
  441.                          entry.
  442. ..page
  443. ..head05L
  444.             TCSet        is the set of extended
  445.                          keyboard characters that are
  446.                          allowed to terminate this
  447.                          procedure.
  448.                          (Refer to appendix C.)
  449.  
  450.             TE           is the terminating element
  451.                          number that terminated the
  452.                          string input procedure.  TE
  453.                          will be in the range of 0-255
  454.                          which corresponds to the
  455.                          element number in appendix C.
  456.  
  457.             St           is the string or character
  458.                          array to receive data from the
  459.                          keyboard.  Upon return the
  460.                          first byte contains the length
  461.                          of the string.
  462.  
  463.             The maximum length of the edit string is
  464.             255 characters.  The data that is entered
  465.             will be entered on one line. If the maximum
  466.             length of the string exceeds the length
  467.             StopX - StartX + 1 the string will scroll
  468.             horizontally on the screen within the
  469.             StartX and StopX columns.
  470.  
  471. Example  :  Var
  472.                St          : String[255];
  473.                TE          : Integer;
  474.                VCSet,TCSet : Set of 0..255;
  475.  
  476.             VCSet := [32..126];
  477.             TCSet := [1,13,72,80];
  478.             Input(5,10,20,30,2,VCSet,TCSet,TE,St);
  479.  
  480.             This example will edit a string of up to
  481.             thirty characters into St.  The screen will
  482.             display the entering of each character
  483.             starting in column 10 on row 5.  The
  484.             display area of the screen goes from
  485.             columns ten to twenty and will do a
  486.             horizontal scroll in that area when the
  487.             eleventh character is entered.
  488.  
  489.             All aphabetic characters, ['A'..'Z',
  490.             'a'..'z'], that are pressed will be
  491.             displayed in upper case.
  492.  
  493.             The keys that will terminate this procedure
  494.             are the Esc, Enter, Up and Down Arrow keys.
  495.             TE will return the proper terminating
  496.             element number as given in appendix C.
  497.  
  498.  
  499. Editing  :  The following gives a brief explanation of
  500.             the editing keys that may be used with
  501.             EditSt, provided the keypressed is not
  502.             defined in the terminating character set.
  503.  
  504.             LeftArr      will move the cursor left one
  505.                          character position on the
  506.                          screen until the StartX column
  507.                          is reached.  If the beginning
  508.                          of the string has not been
  509.                          reached the string will be
  510.                          scrolled on the screen within
  511.                          the startx and stopx column
  512.                          boundaries.
  513.  
  514.             RightArr     will move the cursor right one
  515.                          character position on the
  516.                          screen until the end of the
  517.                          string is reached.  If the
  518.                          cursor is in the stop column
  519.                          and there is still more in the
  520.                          string that can be displayed
  521.                          the string will then be
  522.                          scrolled within the StartX and
  523.                          StopX boundaries.
  524. ..page
  525.             Home         will place the cursor in the
  526.                          StartX column on the screen
  527.                          and positioned under the first
  528.                          character in the edit string.
  529.  
  530.             End          will place the cursor in the
  531.                          StopX column on the screen and
  532.                          positioned after the last
  533.                          character in the edit string.
  534.  
  535.             BackSpace    If the StartX column is
  536.                          displaying the first character
  537.                          in the string being editted
  538.                          the cursor will move to the
  539.                          left one column and delete the
  540.                          character in that column.
  541.  
  542.                          If the character being
  543.                          displayed in the StartX column
  544.                          is not the first character in
  545.                          the string being editted the
  546.                          cursor will remain in the same
  547.                          column position and delete the
  548.                          character to the left of the
  549.                          cursor and pull the string
  550.                          towards the cursor.
  551.  
  552.             Esc          will blank the string
  553.                          currently in the field.  If
  554.                          the field is already blank the
  555.                          procedure will return the
  556.                          string that was passed to this
  557.                          procedure.
  558.  
  559.             Tab or       will move the cursor to the
  560.             Ctrl         right five column positions if
  561.             RightArr     the StopX column has not been
  562.                          reached.  If the StopX column
  563.                          has been reached then only the
  564.                          string display will be
  565.                          adjusted.
  566. ..page
  567.             Ctrl         will move the cursor to the
  568.             LeftArr      left five column positions if
  569.             or           the StartX column has not been
  570.             Shft-Tab     reached. If the cursor is in
  571.                          the StartX column then only
  572.                          the display string will be
  573.                          adjusted to reflect the
  574.                          movement of the cursor.
  575.  
  576.             Del          removes the character the
  577.                          cursor is under and decrements
  578.                          the string length by one.  All
  579.                          the characters to the right of
  580.                          the cursor position are
  581.                          shifted left one character
  582.                          position within the string and
  583.                          the display area.
  584. ..page
  585. ..head03RFILLCOL
  586. ..head04RProcedure
  587. ..head05L_______________________________________________________
  588. Purpose  :  Fill a column on the screen with a
  589.             character.
  590.  
  591. Versions :  2.00   3.00    3.01B
  592.              **     **      **
  593.  
  594. Filename :  V4.ENH
  595.  
  596. Format   :  FillCol(X,Y,Num,Ch);
  597.  
  598. Remarks  :  X            is an integer in the range 1
  599.                          to 40 or 1 to 80, depending
  600.                          upon the screen width.  It
  601.                          gives the absolute column
  602.                          on the screen.
  603.  
  604.             Y            is an integer in the range 1
  605.                          to 25.  It gives the absolute
  606.                          row on the screen.
  607.  
  608.             Num          is an integer in the range 1
  609.                          to 25 for the number of rows
  610.                          to display the character in.
  611.  
  612.             Ch           is the character to be
  613.                          displayed Num times in the
  614.                          column on the screen.
  615.  
  616.             FillCol always acts on the entire screen
  617.             and is NOT sensitive to Turbo's currently
  618.             defined window.
  619.  
  620.  
  621. Example  :  FillCol(1,1,20,'-');
  622.  
  623.             Starting in row one column one twenty
  624.             minus sign characters will be displayed in
  625.             column one.
  626. ..page
  627. ..head03RFILLCOLATTR
  628. ..head04RProcedure
  629. ..head05L_______________________________________________________
  630. Purpose  :  Display a column of attribute bytes to the
  631.             display screen.
  632.  
  633. Versions :  2.00   3.00    3.01B
  634.              **     **      **
  635.  
  636. Filename :  V5.ENH
  637.  
  638. Format   :  FillColAttr(X,Y,Num,Attr);
  639.  
  640. Remarks  :  X            is an integer in the range 1
  641.                          to 40 or 1 to 80, depending
  642.                          upon the screen width.  It
  643.                          gives the absolute column
  644.                          on the screen.
  645.  
  646.             Y            is an integer in the range 1
  647.                          to 25.  It gives the absolute
  648.                          row on the screen.
  649.  
  650.             Num          is an integer in the range 1
  651.                          to 25 for the number of rows
  652.                          to display the attribute byte
  653.                          on.
  654.  
  655.             Attr         is the attr to be displayed
  656.                          Num times in the column on the
  657.                          screen.
  658.  
  659.             FillColAttr always acts on the entire
  660.             screen and is NOT sensitive to Turbo's
  661.             currently defined window.
  662.  
  663.  
  664. Example  :  FillColAttr(1,1,20,48);
  665.  
  666.             In this example the attribute color 48 will
  667.             be displayed 20 times in column 1 starting
  668.             on row one of the screen.
  669. ..page
  670. ..head03RFILLROW
  671. ..head04RProcedure
  672. ..head05L_______________________________________________________
  673. Purpose  :  Write one or more copies of a single
  674.             character to the screen starting at the X,Y
  675.             coordinates passed.
  676.  
  677. Versions :  2.00   3.00    3.01B
  678.              **     **      **
  679.  
  680. Filename :  V6.ENH
  681.  
  682. Format   :  FillRow(X,Y,Num,Ch);
  683.  
  684. Remarks  :  X            is an integer in the range 1
  685.                          to 40 or 1 to 80, depending
  686.                          upon the screen width.  It
  687.                          gives the absolute column
  688.                          on the screen.
  689.  
  690.             Y            is an integer in the range 1
  691.                          to 25.  It gives the absolute
  692.                          row on the screen.
  693.  
  694.             Num          is the number of times to
  695.                          display the character to the
  696.                          screen.
  697.  
  698.             Ch           is the character to be
  699.                          displayed Num times on the
  700.                          screen.
  701.  
  702.             FillRow always acts on the entire screen
  703.             and is NOT sensitive to Turbo's currently
  704.             defined window.
  705.  
  706. Example  :  FillRow(1,1,80,'-');
  707.  
  708.             In this example 80 minus sign characters
  709.             will be displayed starting on row one,
  710.             column one of the screen.
  711. ..page
  712. ..head03RFILLROWATTR
  713. ..head04RProcedure
  714. ..head05L_______________________________________________________
  715. Purpose  :  Write one or more copies of the attribute
  716.             byte to the screen starting at the X,Y
  717.             coordinates passed.
  718.  
  719. Versions :  2.00   3.00    3.01B
  720.              **     **      **
  721.  
  722. Filename :  V7.ENH
  723.  
  724. Format   :  FillRowAttr(X,Y,Num,Attr);
  725.  
  726. Remarks  :  X            is an integer in the range 1
  727.                          to 40 or 1 to 80, depending
  728.                          upon the screen width.  It
  729.                          gives the absolute column
  730.                          on the screen.
  731.  
  732.             Y            is an integer in the range 1
  733.                          to 25.  It gives the absolute
  734.                          row on the screen.
  735.  
  736.             Num          is the number of times to
  737.                          display the attribute byte to
  738.                          the screen.
  739.  
  740.             Attr         is the attribute byte to be
  741.                          displayed Num times on the
  742.                          screen.
  743.  
  744.             FillRowAttr always acts on the entire
  745.             screen and is NOT sensitive to Turbo's
  746.             currently defined window.
  747.  
  748.  
  749. Example  :  FillRowAttr(1,1,80,48);
  750.  
  751.             In this example, starting at row one,
  752.             column one of the screen the color
  753.             attribute byte 48 will be used.
  754. ..page
  755. ..head03RFRAMEWIN
  756. ..head04RProcedure
  757. ..head05L_______________________________________________________
  758. Purpose  :  Frames the window currently defined by
  759.             Turbo with the characters passed.
  760.  
  761. Versions :  2.00   3.00    3.01B
  762.                     **      **
  763.  
  764. Filename :  V8.ENH
  765.  
  766. Format   :  FrameWin(UL,UR,LL,LR,Hor,Ver);
  767.  
  768. Remarks  :  UL           is the character in the upper
  769.                          left corner of the window.
  770.  
  771.             UR           is the character in the upper
  772.                          right corner of the window.
  773.  
  774.             LL           is the character in the lower
  775.                          left corner of the window.
  776.  
  777.             LR           is the character in the lower
  778.                          right corner of the window.
  779.  
  780.             Hor          is the horizontal character
  781.                          for the top and bottom lines
  782.                          of the window.
  783.  
  784.             Ver          is the vertical character for
  785.                          the left and right vertical
  786.                          lines of the window.
  787.  
  788.             FrameWin will outline the window that is
  789.             currently defined by Turbo with the
  790.             characters passed.
  791.  
  792.             Once the window frame has been displayed
  793.             the active window will be adjusted to fit
  794.             within the framed area.
  795. ..PAGE
  796. ..head05L
  797.             For example if the current window is
  798.             defined as 1,1,80,25 then after FrameWin
  799.             the current window will be 2,2,79,24.
  800.  
  801. Example  :  FrameWin('-','-','-','-','-','|');
  802.  
  803.             The above statement will use minus signs
  804.             for the top and bottom lines and the single
  805.             bar for the two sides.
  806.  
  807.  
  808.             FrameWin('L','R','l','r','H','V');
  809.  
  810.             The frame this statement will draw is shown
  811.             below:
  812.  
  813.  
  814.             LHHHHHHHHHHHHHHHHHHHHHHHHHHR
  815.             V                          V
  816.             V                          V
  817.             V                          V
  818.             V                          V
  819.             V                          V
  820.             V                          V
  821.             V                          V
  822.             lHHHHHHHHHHHHHHHHHHHHHHHHHHr
  823. ..page
  824. ..head03RGETCURSORSIZE
  825. ..head04RFunction
  826. ..head05L_______________________________________________________
  827. Purpose  :  Return the starting and ending scan lines
  828.             for the current cursor.
  829.  
  830. Versions :  2.00   3.00    3.01B
  831.              **     **      **
  832.  
  833. Filename :  V9.ENH
  834.  
  835. Format   :  GetCursorSize;
  836.  
  837. Remarks  :  Returns an integer with:
  838.  
  839.                High byte -- starting scan line
  840.                Low byte  -- ending scan line
  841.  
  842. Example  :  Write(Hi(GetCursorSize),Lo(GetCursorSize));
  843.  
  844.             This example will print on one line the
  845.             current starting scan line and ending scan
  846.             line respectively.
  847.  
  848.             i := GetCursorSize;
  849.  
  850.             In this example i will receive the starting
  851.             and ending scan line of the cursor.  The
  852.             high byte will be the starting scan line of
  853.             the cursor and the low byte will be the
  854.             ending scan line of the cursor.
  855. ..page
  856. ..head03RGETSCRN
  857. ..head04RProcedure
  858. ..head05L_______________________________________________________
  859. Purpose  :  Read the character and attribute bytes from
  860.             the screen into a character array.
  861.  
  862. Versions :  2.00   3.00    3.01B
  863.              **     **      **
  864.  
  865. Filename :  V10.ENH
  866.  
  867. Format   :  GetScrn(X,Y,NumWords,ChArray);
  868.  
  869. Remarks  :  X            is an integer in the range 1
  870.                          to 40 or 1 to 80, depending
  871.                          upon the screen width.  It
  872.                          gives the absolute column
  873.                          on the screen.
  874.  
  875.             Y            is an integer in the range 1
  876.                          to 25.  It gives the absolute
  877.                          row on the screen.
  878.  
  879.             NumWords     is an integer in the range 1
  880.                          to 1000 or 1 to 2000,
  881.                          depending upon the screen
  882.                          width.  It gives the number of
  883.                          words to get from the display
  884.                          screen. Its value is the total
  885.                          number of bytes to get divided
  886.                          by 2.
  887.  
  888.             ChArray      is any character or string
  889.                          array that will receive the
  890.                          character and attribute bytes
  891.                          from the screen.  The minimum
  892.                          size of ChArray is NumWords*2.
  893.  
  894.             This procedure works much like Turbo's move
  895.             statement but in addition checks for the
  896.             vertical retrace of the video adapter to
  897.             eliminate the snow effect that the move
  898.             statement would produce on a Color/Graphics
  899.             Adapter.
  900.  
  901. ..head05L
  902.             GetScrn is the inverse of the PutScrn
  903.             procedure.
  904.  
  905.  
  906. Example  :  GetScrn(1,1,80,ChArray[1]);
  907.  
  908.             In this example the size of ChArray is at
  909.             least 160 bytes long.  A copy of row one on
  910.             the screen will be placed in ChArray.
  911.             ChArray will contain both the attribute and
  912.             character bytes from the screen.
  913.  
  914.             In the next example the size of ChArray
  915.             must be at least 320 bytes in size, and the
  916.             first two rows of the screen will be placed
  917.             into ChArray.
  918.  
  919.             GetScrn(1,1,160,ChArray);
  920.  
  921.             Notice that in the first example the
  922.             address of ChArray[1] was passed as the
  923.             parameter and in the second example ChArray
  924.             was not subscripted.  Both examples will
  925.             work because the ChArray parameter is
  926.             defined as an untyped variable.
  927. ..page
  928. ..head03RGETVIDEOMODE
  929. ..head04RFunction
  930. ..head05L_______________________________________________________
  931. Purpose  :  Returns the current video mode.
  932.  
  933. Versions :  2.00   3.00    3.01B
  934.              **     **      **
  935. Filename :  V11.ENH
  936.  
  937. Format   :  GetVideoMode;
  938.  
  939. Remarks  :  Returns an integer giving the current video
  940.             mode the system is in.  Use the guide on
  941.             video modes under INITVIDEO.
  942.  
  943. Example  :  Writeln(GetVideoMode);
  944.  
  945.             This example will print the current video
  946.             mode the system is in.
  947. ..page
  948. ..head03RGOTOXYABS
  949. ..head04RProcedure
  950. ..head05L_______________________________________________________
  951. Purpose  :  Position the cursor at the absolute x,y
  952.             coordinates on the screen.
  953.  
  954. Versions :  2.00   3.00    3.01B
  955.              **     **      **
  956.  
  957. Filename :  V12.ENH
  958.  
  959. Format   :  GotoxyAbs(X,Y);
  960.  
  961. Remarks  :  X            is an integer in the range 1
  962.                          to 40 or 1 to 80, depending
  963.                          upon the screen width.  It
  964.                          gives the absolute column
  965.                          on the screen.
  966.  
  967.             Y            is an integer in the range 1
  968.                          to 25.  It gives the absolute
  969.                          row on the screen.
  970.  
  971.             This procedure will place the cursor at the
  972.             x,y coordinates of the physical screen.
  973.             GotoxyAbs is NOT sensitive to the window
  974.             that is currently defined by turbo.
  975. ..page
  976. ..head03RINITVIDEO
  977. ..head04RProcedure
  978. ..head05L_______________________________________________________
  979. Purpose  :  Initialize the video mode.
  980.  
  981. Versions :  2.00   3.00    3.01B
  982.              **     **      **
  983.  
  984. Filename :  V13.ENH
  985.  
  986. Format   :  InitVideo(Mode);
  987.  
  988. Remarks  :  To set the screen to the appropriate video
  989.             mode use the following table as a guide.
  990.  
  991.  
  992.   -----------------------------------------------------
  993.   |  Mode |         Type          | Colors | Adaptera |
  994.   -----------------------------------------------------
  995.   |    0  |  Text - 40 x 25 B/W   |  b/w   |   CGA    |
  996.   |    1  |  Text - 40 x 25 COLOR |  16    |   CGA    |
  997.   |    2  |  Text - 80 x 25 B/W   |  b/w   |   CGA    |
  998.   |    3  |  Text - 80 x 25 COLOR |  16    |   CGA    |
  999.   |    4  |  Graphics - 320 x 200 |   4    |   CGA    |
  1000.   |    5  |  Graphics - 320 x 200 | 4 grey |   CGA    |
  1001.   |    6  |  Graphics - 640 x 200 |  b/w   |   CGA    |
  1002.   |    7  |  Text - 80 x 25       |  16    |   MA     |
  1003.   |    8  |  Graphics - 160 x 200 |  16    |   PCjr   |
  1004.   |    9  |  Graphics - 320 x 200 |  4,64  |   PCjr   |
  1005.   |   10  |  Graphics - 640 x 200 |  16    | PCjr,EGA |
  1006.   |   13  |  Graphics - 320 x 200 |  16    |   EGA    |
  1007.   |   14  |  Graphics - 640 x 200 |  16    |   EGA    |
  1008.   |   15  |  Graphics - 640 x 350 |   4    |   EGA    |
  1009.    ----------------------------------------------------
  1010.  
  1011. Example  :  InitVideo(3);
  1012.  
  1013.             This example will initialize the video mode
  1014.             to 80 x 25 color text.
  1015. ..page
  1016. ..head03RPUTSCRN
  1017. ..head04RProcedure
  1018. ..head05L_______________________________________________________
  1019. Purpose  :  Display character and attribute on the
  1020.             screen.
  1021.  
  1022. Versions :  2.00   3.00    3.01B
  1023.              **     **      **
  1024.  
  1025. Filename :  V14.ENH
  1026.  
  1027. Format   :  PutScrn(X,Y,NumWords,ChArray);
  1028.  
  1029. Remarks  :  X            is an integer in the range 1
  1030.                          to 40 or 1 to 80, depending
  1031.                          upon the screen width.  It
  1032.                          gives the absolute column
  1033.                          on the screen.
  1034.  
  1035.             Y            is an integer in the range 1
  1036.                          to 25.  It gives the absolute
  1037.                          row on the screen.
  1038.  
  1039.             NumWords     is the number of words to
  1040.                          display.
  1041.  
  1042.             ChArray      is the character array that
  1043.                          contains the bytes to display
  1044.                          on the screen.  The minimum
  1045.                          size of ChArray is NumChars*2.
  1046.  
  1047.             This procedure works much like Turbo's move
  1048.             statement but in addition checks for the
  1049.             vertical retrace of the video adapter to
  1050.             eliminate the snow effect that the move
  1051.             statement would produce on a Color/Graphics
  1052.             Adapter.
  1053.  
  1054.             PutScrn is the inverse of the GetScrn
  1055.             procedure.
  1056. ..page
  1057. ..head05L
  1058. Example  : PutScrn(1,1,80,ChArray[1]);
  1059.  
  1060.              In this example the size of ChArray is at
  1061.              least 160 bytes long.  The first 160 bytes
  1062.              of ChArray will be placed on the screen
  1063.              starting at row one column one of the
  1064.              screen.  Both the attribute and character
  1065.              bytes will be written to the screen.
  1066.  
  1067.              In the next example the size of ChArray
  1068.              must be at least 320 bytes in size, and
  1069.              will write 320 bytes to the first two rows
  1070.              of the screen.
  1071.  
  1072.              PutScrn(1,1,160,ChArray);
  1073.  
  1074.              Notice that in the first example the
  1075.              address of ChArray[1] was passed as the
  1076.              parameter and in the second example
  1077.              ChArray was not subscripted.  Both
  1078.              examples will work because the ChArray
  1079.              parameter is defined as an untyped
  1080.              variable.
  1081. ..page
  1082. ..head03RRVSVIDEO
  1083. ..head04RProcedure
  1084. ..head05L_______________________________________________________
  1085. Purpose  :  Reverses current video attribute bytes.
  1086.  
  1087. Versions :  2.00   3.00    3.01B
  1088.                     **      **
  1089.  
  1090. Filename :  V15.ENH
  1091.  
  1092. Format   :  RvsVideo;
  1093.  
  1094.  
  1095. Remarks  :  RvsVideo exchanges the three foreground and
  1096.             three background attribute bits that are
  1097.             currently defined by Turbo Pascal's
  1098.             attribute byte.
  1099.  
  1100. Example  :  Foreground color --> white.
  1101.             Background color --> black.
  1102.  
  1103.             If the above is true for the foreground and
  1104.             background colors then after calling
  1105.             RvsVideo the foreground and background
  1106.             colors will be as follows:
  1107.  
  1108.             Foreground color --> black.
  1109.             background color --> white.
  1110. ..page
  1111. ..head03RSCROLLDOWN
  1112. ..head04RProcedure
  1113. ..head05L_______________________________________________________
  1114. Purpose  :  Scroll the window down N lines filling in
  1115.             blank lines at the top of the window with
  1116.             the attribute passed.
  1117.  
  1118. Versions :  2.00   3.00    3.01B
  1119.              **     **      **
  1120.  
  1121. Filename :  V16.ENH
  1122.  
  1123. Format   :  ScrollDown(Lines,Attr,X1,Y1,X2,Y2);
  1124.  
  1125. Remarks  :  Lines        is an integer in the range 0
  1126.                          to 25.  If gives the number of
  1127.                          lines the window is to be
  1128.                          scrolled.
  1129.  
  1130.             Attr         is an integer in the range 0
  1131.                          to 255.  It gives the
  1132.                          attribute to be used when
  1133.                          filling in the blank lines at
  1134.                          the top of the window.
  1135.  
  1136.             X1           is an integer in the range 1
  1137.                          to 40 or 1 to 80, depending
  1138.                          upon the screen width.  It
  1139.                          gives the left column of the
  1140.                          window on the screen.
  1141.  
  1142.             Y1           is an integer in the range 1
  1143.                          to 25.  It gives the top row
  1144.                          of the window on the screen.
  1145.  
  1146.             X2           is an integer in the range 1
  1147.                          to 40 or 1 to 80, depending
  1148.                          upon the screen width.  It
  1149.                          gives the right column of the
  1150.                          window on the screen.
  1151. ..page
  1152. ..head05L
  1153.             Y2           is an integer in the range 1
  1154.                          to 25.  It gives the bottom
  1155.                          row of the window on the
  1156.                          screen.
  1157.  
  1158. Example  :  ScrollDown(1,48,4,5,15,20);
  1159.  
  1160.             In this example one line will be scrolled
  1161.             down in the window with the top row (row 5)
  1162.             being filled in with cyan on a
  1163.             Color/Graphics Adapter.
  1164.  
  1165.             ScrollDown(0,7,4,5,15,20);
  1166.  
  1167.             In this example the entire window will be
  1168.             cleared.
  1169. ..page
  1170. ..head03RSCROLLLEFT
  1171. ..head04RProcedure
  1172. ..head05L_______________________________________________________
  1173. Purpose  :  Scroll the window to the left N columns
  1174.             filling in blank columns at the right of
  1175.             the window with the attribute passed.
  1176.  
  1177. Versions :  2.00   3.00    3.01B
  1178.              **     **      **
  1179.  
  1180. Filename :  V17.ENH
  1181.  
  1182. Format   :  ScrollLeft(Cols,Attr,X1,Y1,X2,Y2);
  1183.  
  1184. Remarks  :  Cols         is an integer in the range 0
  1185.                          to 25.  If gives the number of
  1186.                          columns the window is to be
  1187.                          scrolled left.
  1188.  
  1189.             Attr         is an integer in the range 0
  1190.                          to 255.  It gives the
  1191.                          attribute to be used when
  1192.                          filling in the blank lines at
  1193.                          the top of the window.
  1194.  
  1195.             X1           is an integer in the range 1
  1196.                          to 40 or 1 to 80, depending
  1197.                          upon the screen width.  It
  1198.                          gives the left column of the
  1199.                          window on the screen.
  1200.  
  1201.             Y1           is an integer in the range 1
  1202.                          to 25.  It gives the top row
  1203.                          of the window on the screen.
  1204.  
  1205.             X2           is an integer in the range 1
  1206.                          to 40 or 1 to 80, depending
  1207.                          upon the screen width.  It
  1208.                          gives the right column of the
  1209.                          window on the screen.
  1210. ..page
  1211. ..head05L
  1212.             Y2           is an integer in the range 1
  1213.                          to 25.  It gives the bottom
  1214.                          row of the window on the
  1215.                          screen.
  1216.  
  1217.  
  1218. Example  :  ScrollLeft(1,48,4,5,15,20);
  1219.  
  1220.             In this example one column will be scrolled
  1221.             left in the window with the right column
  1222.             (col 15) being filled in with cyan
  1223.             on a Color/Graphics Adapter.
  1224.  
  1225.             ScrollLeft(0,7,4,5,15,20);
  1226.  
  1227.             In this example the entire window will be
  1228.             cleared.
  1229. ..page
  1230. ..head03RSCROLLUP
  1231. ..head04RProcedure
  1232. ..head05L_______________________________________________________
  1233. Purpose  :  Scroll the window up N lines filling in
  1234.             blank lines at the bottom of the window
  1235.             with the attribute passed.
  1236.  
  1237. Versions :  2.00   3.00    3.01B
  1238.              **     **      **
  1239.  
  1240. Filename :  V18.ENH
  1241.  
  1242. Format   :  ScrollUp(Lines,Attr,X1,Y1,X2,Y2);
  1243.  
  1244. Remarks  :  Lines        is an integer in the range 0
  1245.                          to 25.  If gives the number of
  1246.                          lines the window is to be
  1247.                          scrolled.
  1248.  
  1249.             Attr         is an integer in the range 0
  1250.                          to 255.  It gives the
  1251.                          attribute to be used when
  1252.                          filling in the blank lines at
  1253.                          the top of the window.
  1254.  
  1255.             X1           is an integer in the range 1
  1256.                          to 40 or 1 to 80, depending
  1257.                          upon the screen width.  It
  1258.                          gives the left column of the
  1259.                          window on the screen.
  1260.  
  1261.             Y1           is an integer in the range 1
  1262.                          to 25.  It gives the top row
  1263.                          of the window on the screen.
  1264.  
  1265.             X2           is an integer in the range 1
  1266.                          to 40 or 1 to 80, depending
  1267.                          upon the screen width.  It
  1268.                          gives the right column of the
  1269.                          window on the screen.
  1270. ..page
  1271. ..head05L
  1272.             Y2           is an integer in the range 1
  1273.                          to 25.  It gives the bottom
  1274.                          row of the window on the
  1275.                          screen.
  1276.  
  1277.  
  1278. Example  :  ScrollUp(1,48,4,5,15,20);
  1279.  
  1280.             In this example one line will be scrolled
  1281.             up in the window with the bottom line (row
  1282.             20) being filled in with cyan on a
  1283.             Color/Graphics Adapter.
  1284.  
  1285.             ScrollUp(0,7,4,5,15,20);
  1286.  
  1287.             In this example the entire window will be
  1288.             cleared.
  1289. ..page
  1290. ..head03RSCROLLRIGHT
  1291. ..head04RProcedure
  1292. ..head05L_______________________________________________________
  1293. Purpose  :  Scroll the window right N columns filling
  1294.             in blank columns at the left of the window
  1295.             with the attribute passed.
  1296.  
  1297. Versions :  2.00   3.00    3.01B
  1298.              **     **      **
  1299.  
  1300. Filename :  V19.ENH
  1301.  
  1302. Format   :  ScrollRight(Cols,Attr,X1,Y1,X2,Y2);
  1303.  
  1304. Remarks  :  Lines        is an integer in the range 0
  1305.                          to 25.  If gives the number of
  1306.                          lines the window is to be
  1307.                          scrolled.
  1308.  
  1309.             Attr         is an integer in the range 0
  1310.                          to 255.  It gives the
  1311.                          attribute to be used when
  1312.                          filling in the blank lines at
  1313.                          the top of the window.
  1314.  
  1315.             X1           is an integer in the range 1
  1316.                          to 40 or 1 to 80, depending
  1317.                          upon the screen width.  It
  1318.                          gives the left column of the
  1319.                          window on the screen.
  1320.  
  1321.             Y1           is an integer in the range 1
  1322.                          to 25.  It gives the top row
  1323.                          of the window on the screen.
  1324.  
  1325.             X2           is an integer in the range 1
  1326.                          to 40 or 1 to 80, depending
  1327.                          upon the screen width.  It
  1328.                          gives the right column of the
  1329.                          window on the screen.
  1330. ..page
  1331. ..head05L
  1332.             Y2           is an integer in the range 1
  1333.                          to 25.  It gives the bottom
  1334.                          row of the window on the
  1335.                          screen.
  1336.  
  1337.  
  1338. Example  :  ScrollRight(1,48,4,5,15,20);
  1339.  
  1340.             In this example one column will be scrolled
  1341.             to the right in the window with the left
  1342.             column (col 4) being filled in with cyan
  1343.             on a Color/Graphics Adapter.
  1344.  
  1345.             ScrollRight(0,7,4,5,15,20);
  1346.  
  1347.             In this example the entire window will be
  1348.             cleared.
  1349. ..page
  1350. ..head03RSETCURSORSIZE
  1351. ..head04RProcedure
  1352. ..head05L_______________________________________________________
  1353. Purpose  :  Set the size of the cursor.
  1354.  
  1355. Versions :  2.00   3.00    3.01B
  1356.              **     **      **
  1357.  
  1358. Filename :  V20.ENH
  1359.  
  1360. Format   :  SetCursorSize(StartLine,EndLine);
  1361.  
  1362. Remarks  :  StartLine    is an integer giving the
  1363.                          starting scan line to be used
  1364.                          for the cursor.
  1365.  
  1366.             EndLine      is an integer giving the
  1367.                          ending scan line to be used
  1368.                          for the cursor.
  1369.  
  1370.             StartLine and EndLine must be of Data Type
  1371.             Byte or Integer.
  1372.  
  1373.             The scan lines are numbered from 0 at the
  1374.             top (StartLine) to N at the bottom
  1375.             (EndLine) where N applies to the following
  1376.             video adapters.
  1377.  
  1378.                 7 - Color/Graphics Adapter
  1379.                14 - Monochrome Adapter
  1380.  
  1381. Example  :  The following examples are for the
  1382.             Color/Graphics Adapter:
  1383.  
  1384.             SetCursorSize(32,32);
  1385.  
  1386.             Makes the cursor invisible on the screen.
  1387.  
  1388.             SetCursorSize(0,7);
  1389.  
  1390.             Enlarges the cursor, covering the entire
  1391.             character cell.
  1392. ..page
  1393. ..head03RWAITMSG
  1394. ..head04RProcedure
  1395. ..head05L_______________________________________________________
  1396. Purpose  :  Display a message on the screen and waits
  1397.             until one of the specified keys is pressed
  1398.             to continue.
  1399.  
  1400. Versions :  2.00   3.00    3.01B
  1401.              **     **      **
  1402.  
  1403. Filename :  V21.ENH
  1404.  
  1405. Format   :  WaitMsg(X,Y,Msg,TCSet,TE);
  1406.  
  1407. Remarks  :  X            is an integer in the range 1
  1408.                          to 40 or 1 to 80, depending
  1409.                          upon the screen width.  It
  1410.                          gives the absolute column
  1411.                          on the screen.
  1412.  
  1413.             Y            is an integer in the range 1
  1414.                          to 25.  It gives the absolute
  1415.                          row on the screen.
  1416.  
  1417.             Msg          is any string expression.  It
  1418.                          gives the message that is to
  1419.                          be displayed on the screen.
  1420.  
  1421.             TCSet        is the set of key combination
  1422.                          elements that are allowed to
  1423.                          terminate this procedure.
  1424.                          (Refer to appendix C)
  1425.  
  1426.             TE           is an integer that will return
  1427.                          a value in the range 0-255.  It
  1428.                          corresponds to the terminating
  1429.                          element number given in
  1430.                          appendix C.
  1431. ..page
  1432. ..head05L
  1433. Example  :  WaitMsg(1,25,'Printer error',[1,13],TE);
  1434.  
  1435.             This example will print the message
  1436.             'Printer error' starting in column one on
  1437.             row 25.  After the message is displayed the
  1438.             procedure will wait until either the ESC or
  1439.             ENTER key is pressed before conti- nuing.
  1440.  
  1441.             Global type definition for TCSet is:
  1442.  
  1443.                TCSet = Set of 0..255;
  1444. ..page
  1445. ..head03RWHEREXABS
  1446. ..head04RFunction
  1447. ..head05L_______________________________________________________
  1448. Purpose  :  Returns the absolute column of the cursor
  1449.             on the physical window.
  1450.  
  1451. Versions :  2.00   3.00    3.01B
  1452.              **     **      **
  1453.  
  1454. Filename :  V22.ENH
  1455.  
  1456. Format   :  WhereXAbs;
  1457.  
  1458. Remarks  :  This function will return an integer in the
  1459.             range of 1 to 80 for 80 column text modes,
  1460.             and 1 to 40 for 40 column text modes.
  1461.  
  1462. Example  :  i := WhereXAbs;
  1463.  
  1464.             The variable i will receive the absolute
  1465.             column of the cursor regardless of Turbo
  1466.             Pascal's currently defined window.
  1467. ..page
  1468. ..head03RWHEREYABS
  1469. ..head04RFunction
  1470. ..head05L_______________________________________________________
  1471. Purpose  :  Returns the absolute row of the cursor on
  1472.             the physical window.
  1473.  
  1474. Versions :  2.00   3.00    3.01B
  1475.              **     **      **
  1476.  
  1477. Filename :  V23.ENH
  1478.  
  1479. Format   :  WhereYAbs;
  1480.  
  1481. Remarks  :  This function will return an integer in the
  1482.             range of 1 to 25.
  1483.  
  1484. Example  :  i := WhereYAbs;
  1485.  
  1486.             The variable i will receive the absolute
  1487.             row of the cursor regardless of Turbo
  1488.             Pascal's currently defined window
  1489. ..page
  1490. ..head03RWRITEST
  1491. ..head04RProcedure
  1492. ..head05L_______________________________________________________
  1493. Purpose  :  Display a string to the screen
  1494.  
  1495. Versions :  2.00   3.00    3.01B
  1496.              **     **      **
  1497.  
  1498. Filename :  V24.ENH
  1499.  
  1500. Format   :  WriteSt(St);
  1501.  
  1502. Remarks  :  St           is any string expression.
  1503.  
  1504.             WriteSt positions the cursor after the
  1505.             newly displayed string.
  1506.  
  1507.             WriteSt is NOT sensitive to Turbo's
  1508.             currently defined window and will wrap
  1509.             around to the next row of column one of the
  1510.             physical screen when necessary.
  1511.  
  1512.             WriteSt will not scroll the screen if the
  1513.             data to be displayed is to extend beyond
  1514.             the last row of the screen.
  1515.  
  1516. Special Note :  WriteSt requires a global type
  1517.                 definition of:
  1518.  
  1519.                 Str255 = String[255];
  1520. ..page
  1521. ..head03RWRITESTLN
  1522. ..head04RProcedure
  1523. ..head05L_______________________________________________________
  1524. Purpose  :  Display a string to the screen.
  1525.  
  1526. Versions :  2.00   3.00    3.01B
  1527.              **     **      **
  1528.  
  1529. Filename :  V25.ENH
  1530.  
  1531. Format   :  WriteStln(St);
  1532.  
  1533.  
  1534. Remarks  :  St           is any string expression.
  1535.  
  1536.             The cursor is positioned in column one on
  1537.             the next line of the physical screen after
  1538.             the data has been displayed.
  1539.  
  1540.             WriteStln is NOT sensitive to Turbo's
  1541.             currently defined window and will wrap
  1542.             around to the next row in column one when
  1543.             necessary.
  1544.  
  1545.             WriteSt will not scroll the screen if the
  1546.             data to be displayed is to extend beyond
  1547.             the last row of the screen.
  1548.  
  1549. Special Note :  WriteStln requires a global type
  1550.                 definition of:
  1551.  
  1552.                 Str255 = String[255];
  1553. ..page
  1554. ..pgno01
  1555. ..head03RCLRKBD
  1556. ..head04RProcedure
  1557. ..head05L______________________________________________________
  1558. ..foot48R3-##
  1559. Purpose  :  Clears the keyboard buffer.
  1560.  
  1561. Versions :  2.00   3.00    3.01B
  1562.              **     **      **
  1563.  
  1564. Format   :  ClrKbd;
  1565.  
  1566.  
  1567. Remarks  :  This procedure will delete any characters
  1568.             in the keyboard buffer waiting to be read.
  1569.  
  1570. Example  :  ClrKbd;
  1571.             ReadKbd(Ch);
  1572.               .
  1573.               .
  1574.               .
  1575.  
  1576.             In this example the keyboard buffer is
  1577.             flushed before reading a keystroke from the
  1578.             keyboard.
  1579. ..page
  1580. ..head03RGETKBDELMT
  1581. ..head04RProcedure
  1582. ..head05L______________________________________________________
  1583. Purpose  :  Return an integer value for the key pressed
  1584.             on the keyboard.
  1585.  
  1586. Versions :  2.00   3.00    3.01B
  1587.              **     **      **
  1588.  
  1589. Format   :  GetKbdElmt(i);
  1590.  
  1591. Remarks  :  GetKbdElmt will return an integer in the
  1592.             range of 0 to 388.  Use Appendix C to find
  1593.             the appropriate keyboard return codes of
  1594.             this procedure.
  1595.  
  1596. Example  :  GetKbdElmt(i);
  1597.  
  1598.             If the key combination control-break was
  1599.             pressed, then on return from the procedure
  1600.             call GetKbdElmt i would contain the value
  1601.             of zero.
  1602.  
  1603.             If the 'A' was pressed then i would have
  1604.             returned the value 197.
  1605.  
  1606. Note      : Generally all of the key combinations using
  1607.             the control key with an alphabetic
  1608.             character and all other ascii characters
  1609.             will be offset by 132.
  1610.  
  1611.             If you study Appendix C you might be able
  1612.             to understand why things were done this
  1613.             way.
  1614.  
  1615. ..page
  1616. ..head03RKBDSTATUS
  1617. ..head04RFunction
  1618. ..head05L______________________________________________________
  1619. Purpose  :  Return the keyboard status byte
  1620.  
  1621. Versions :  2.00   3.00    3.01B
  1622.              **     **      **
  1623.  
  1624. Format   :  n := KbdStatus;
  1625.  
  1626.  
  1627. Remarks  :  KbdStatus returns the keyboard status byte
  1628.             as follows:
  1629.  
  1630.                        BITS
  1631.  
  1632.             ---------------------------------
  1633.             | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  1634.             ---------------------------------
  1635.  
  1636.             Bit   Bit Value    Key Pressed
  1637.             ---   ---------    -----------
  1638.              0  -      1    -  Right Shift
  1639.              1  -      2       Left Shift
  1640.              2  -      4       Control
  1641.              3  -      8       Alternate
  1642.  
  1643.                                  Key Mode
  1644.                                -----------
  1645.              4  -     16       Scroll Lock
  1646.              5  -     32       Num Lock
  1647.              6  -     64       Caps Lock
  1648.              7  -    128       Insert
  1649.  
  1650.             A one in the bit position means the
  1651.             condition is true and a zero in the bit
  1652.             position means the condition is false.
  1653.  
  1654. Example  :  If (KbdStatus And 6) <> 0 Then . . .
  1655.  
  1656.             The above example checks to see if either
  1657.             of the CONTROL or the LEFT SHIFT keys are
  1658.             pressed.
  1659. ..page
  1660. ..head03RREADKBD
  1661. ..head04RProcedure
  1662. ..head05L______________________________________________________
  1663. Purpose  :  Read a character from the keyboard.
  1664.  
  1665. Versions :  2.00   3.00    3.01B
  1666.              **     **      **
  1667.  
  1668. Format   :  ReadKbd(Ch);
  1669.  
  1670.  
  1671. Remarks  :  ReadKbd reads a single character from the
  1672.             keyboard buffer.  ReadKbd will return a
  1673.             zero, one, or two character string.
  1674.  
  1675.             A null string indicates that Ctrl-Break was
  1676.             pressed.
  1677.  
  1678.             A one-character string indicates a normal
  1679.             ascii character was read from the keyboard.
  1680.  
  1681.             A two-character string indicates a special
  1682.             extended keyboard code.  Refer to appendix
  1683.             B for a list of the extended keyboard
  1684.             codes.
  1685.  
  1686.             The data type definition for ReadKbd is an
  1687.             untyped variable using a minimun of three
  1688.             bytes.
  1689.  
  1690. Example  :  Type
  1691.                Str2 = String[2];
  1692.             Var
  1693.                Ch : Str2;
  1694.             Begin
  1695.                ReadKbd(Ch);
  1696.                Case Ch[1] Of
  1697.                   #00 : Writeln('Ctrl char pressed');
  1698.                   #27 : Writeln('Other key comb used');
  1699.                   #32..#127 : Writeln('Ascii pressed');
  1700.                End;
  1701.             End.
  1702. ..page
  1703. ..head05
  1704.             In this example any key or key combination
  1705.             that is read from the keyboard will be
  1706.             grouped into one of three categories.
  1707.  
  1708.             If Ch[1] is equal to the null byte then the
  1709.             chances are that one of the control
  1710.             characters (0-31) was pressed.  This
  1711.             includes the enter key, backspace, tab, and
  1712.             key combinations that use the control and
  1713.             an ACSII character A-Z.
  1714.  
  1715.             If Ch[1] is equal to #27 then the chances
  1716.             are that some other key combination was
  1717.             used, generally involving the alt key or
  1718.             control key with one of the function keys
  1719.             or cursor movement keys.
  1720.  
  1721.             If Ch[1] is in the range #32..#127 then an
  1722.             ASCII character was pressed.  The length
  1723.             will also be one, where as in the other two
  1724.             possibilites the length will be two.
  1725. ..page
  1726. ..pgno01
  1727. ..head03R
  1728. ..head04CSUMMARY OF PROCEDURES AND FUNCTIONS
  1729. ..head05L_______________________________________________________
  1730. ..foot48RA-##
  1731. VIDEO PROCEDURES AND FUNCTIONS
  1732.  
  1733. PROCEDURES
  1734.  
  1735.   BoarderColor(Color : Integer);
  1736.   ClrWin;
  1737.   ColorMsg(Y,X,Color : Integer; Message : Str255);
  1738.   EditSt(X,StartY,StopX,Len,CM : Integer;
  1739.                    VCSet,TCSet : TSet;
  1740.                Var TE          : Integer;
  1741.                Var St                   );
  1742.   FillCol(Y,X,Num : Integer; Ch : Char);
  1743.   FillColAttr(Y,X,Num,Color : Integer);
  1744.   FillRow(Y,X,Num : Integer; Ch : Char);
  1745.   FillRowAttr(Y,X,Num,Color : Integer);
  1746.   FrameWin(UL,UR,LL,LR,Hor,Ver : Char);
  1747.   GetScrn(Y,X,NumChars : Integer; Var ChArray);
  1748.   GetScrnAttr(Y,X,NumBytes : Integer; Var ChArray);
  1749.   GotoXYAbs(Y,X : Integer);
  1750.   InitVideo(Mode : Integer);
  1751.   PutScrn(Y,X,NumChars : Integer; Var ChArray);
  1752.   RvsVideo;
  1753.   ScrollDn(Lines,Color,Y1,X1,Y2,X2 : Integer);
  1754.   ScrollLeft(Columns,Color,Y1,X1,Y2,X2 : Integer);
  1755.   ScrollUp(Lines,Color,Y1,X1,Y2,X2 : Integer);
  1756.   ScrollRight(Columns,Color,Y1,X1,Y2,X2 : Integer);
  1757.   SetCursorSize(StartLine,EndLine : Integer);
  1758.   WaitMsg(Y,X : Integer;     St : Str255;
  1759.                          Var TE : Integer);
  1760.   WriteSt(St : Str255);
  1761.   WriteStLn(St : Str255);
  1762.  
  1763. FUNCTIONS
  1764.  
  1765.   GetCursorSize : Integer;
  1766.   GetVideoMode  : Integer;
  1767.   WhereXAbs     : Integer;
  1768.   WhereYAbs     : Integer;
  1769. ..page
  1770. ..head05
  1771. KEYBOARD PROCEDURES AND FUNCTIONS
  1772.  
  1773. PROCEDURES
  1774.  
  1775.   ClrKbd;
  1776.   GetKbdElmt(Var ElmtNum : Integer);
  1777.   ReadKbd(Var Ch);
  1778.  
  1779. FUNCTIONS
  1780.  
  1781.   KbdStatus : Integer;
  1782. ..page
  1783. ..pgno01
  1784. ..head03R
  1785. ..head04CKEYBOARD RETURN CODES
  1786. ..head05L_______________________________________________________
  1787. ..foot48RB-##
  1788. This appendix lists the keyboard codes for all the key
  1789. combinations for the entire keyboard, as they are seen
  1790. by the procedure READKBD.  All keys are turned into
  1791. either a one or two character code.
  1792.  
  1793. To understand the table below assume St is a two
  1794. character string.  St[0] is the length of the character
  1795. code returned.  If the length of St is one then a
  1796. normal ASCII character was pressed, otherwise an
  1797. extended code is generated.  Notice that some of the
  1798. keyboard codes do produce a two character code with the
  1799. first character being null.
  1800.  
  1801. If the length of St is one then a normal ASCII
  1802. character code was read from the keyboard.  This
  1803. basically covers the ASCII values 32-127.
  1804.  
  1805. If the length of St is two then one of the keys, that
  1806. are usually used for cursor control, was read from the
  1807. keyboard.  If this is the case then St[1] will be
  1808. either a 0 or 27 depending on the key combination read
  1809. from the keyboard.
  1810.  
  1811. Use of the case statement works well with this type of
  1812. setup to determine which keyboard keys were read from
  1813. the keyboard.
  1814.  
  1815. Case Ch[1] Of
  1816.    #00       : Writeln('Control code used.');
  1817.    #27       : Writeln('Control code used.');
  1818.    #32..#127 : Writeln('Printable code used.');
  1819. End;
  1820. ..page
  1821. ..head03R
  1822. ..head04R
  1823. ..head05L
  1824. Key                         Key
  1825. Pressed   CH[0] CH[1] CH[2] Pressed   CH[0] CH[1] CH[2]
  1826. --------- ----- ----- ----- --------- ----- ----- -----
  1827. (space)      1    32     0  E            1    69     0
  1828. !            1    33     0  F            1    70     0
  1829. "            1    34     0  G            1    71     0
  1830. #            1    35     0  H            1    72     0
  1831. $            1    36     0  I            1    73     0
  1832. %            1    37     0  J            1    74     0
  1833. &            1    38     0  K            1    75     0
  1834. '            1    39     0  L            1    76     0
  1835. (            1    40     0  M            1    77     0
  1836. )            1    41     0  N            1    78     0
  1837. *            1    42     0  O            1    79     0
  1838. +            1    43     0  P            1    80     0
  1839. ,            1    44     0  Q            1    81     0
  1840. -            1    45     0  R            1    82     0
  1841. .            1    46     0  S            1    83     0
  1842. /            1    47     0  T            1    84     0
  1843. 0            1    48     0  U            1    85     0
  1844. 1            1    49     0  V            1    86     0
  1845. 2            1    50     0  W            1    87     0
  1846. 3            1    51     0  X            1    88     0
  1847. 4            1    52     0  Y            1    89     0
  1848. 5            1    53     0  Z            1    90     0
  1849. 6            1    54     0  [            1    91     0
  1850. 7            1    55     0  \            1    92     0
  1851. 8            1    56     0  ]            1    93     0
  1852. 9            1    57     0  ^            1    94     0
  1853. :            1    58     0  _            1    95     0
  1854. ;            1    59     0  `            1    96     0
  1855. <            1    60     0  a            1    97     0
  1856. =            1    61     0  b            1    98     0
  1857. >            1    62     0  c            1    99     0
  1858. ?            1    63     0  d            1   100     0
  1859. @            1    64     0  e            1   101     0
  1860. A            1    65     0  f            1   102     0
  1861. B            1    66     0  g            1   103     0
  1862. C            1    67     0  h            1   104     0
  1863. D            1    68     0  i            1   105     0
  1864. ..page
  1865. Key                         Key
  1866. Pressed   Ch[0] Ch[1] Ch[2] Pressed   Ch[0] Ch[1] Ch[2]
  1867. --------- ----- ----- ----- --------- ----- ----- -----
  1868. j            1   106     0  Alt-I        2    27    23
  1869. k            1   107     0  Alt-O        2    27    24
  1870. l            1   108     0  Alt-P        2    27    25
  1871. m            1   109     0  Alt-A        2    27    30
  1872. n            1   110     0  Alt-S        2    27    31
  1873. o            1   111     0  Alt-D        2    27    32
  1874. p            1   112     0  Alt-F        2    27    33
  1875. q            1   113     0  Alt-G        2    27    34
  1876. r            1   114     0  Alt-H        2    27    35
  1877. s            1   115     0  Alt-J        2    27    36
  1878. t            1   116     0  Alt-K        2    27    37
  1879. u            1   117     0  Alt-L        2    27    38
  1880. v            1   118     0  Alt-Z        2    27    44
  1881. w            1   119     0  Alt-X        2    27    45
  1882. x            1   120     0  Alt-C        2    27    46
  1883. y            1   121     0  Alt-V        2    27    47
  1884. z            1   122     0  Alt-B        2    27    48
  1885. {            1   123     0  Alt-N        2    27    49
  1886. |            1   124     0  Alt-M        2    27    50
  1887. }            1   125     0  F1           2    27    59
  1888. ~            1   126     0  F2           2    27    60
  1889. Ctrl-Break   2    27     0  F3           2    27    61
  1890. Esc          2    27     1  F4           2    27    62
  1891. Ctrl-2       2    27     3  F5           2    27    63
  1892. BackSp       2    27     8  F6           2    27    64
  1893. Tab          2    27     9  F7           2    27    65
  1894. Ctrl-Enter   2    27    10  F8           2    27    66
  1895. Enter        2    27    13  F9           2    27    67
  1896. Ctrl-BS      2    27    14  F10          2    27    68
  1897. Shft-Tab     2    27    15  Home         2    27    71
  1898. Alt-Q        2    27    16  UArr         2    27    72
  1899. Alt-W        2    27    17  PgUp         2    27    73
  1900. Alt-E        2    27    18  LArr         2    27    75
  1901. Alt-R        2    27    19  RArr         2    27    77
  1902. Alt-T        2    27    20  End          2    27    79
  1903. Alt-Y        2    27    21  DArr         2    27    80
  1904. Alt-U        2    27    22  PgDn         2    27    81
  1905. ..page
  1906. Key                         Key
  1907. Pressed   Ch[0] Ch[1] Ch[2] Pressed   Ch[0] Ch[1] Ch[2]
  1908. --------- ----- ----- ----- --------- ----- ----- -----
  1909. Ins          2    27    82  Alt-1        2    27   120
  1910. Del          2    27    83  Alt-2        2    27   121
  1911. Shft-F1      2    27    84  Alt-3        2    27   122
  1912. Shft-F2      2    27    85  Alt-4        2    27   123
  1913. Shft-F3      2    27    86  Alt-5        2    27   124
  1914. Shft-F4      2    27    87  Alt-6        2    27   125
  1915. Shft-F5      2    27    88  Alt-7        2    27   126
  1916. Shft-F6      2    27    89  Alt-8        2    27   127
  1917. Shft-F7      2    27    90  Alt-9        2    27   128
  1918. Shft-F8      2    27    91  Alt-0        2    27   129
  1919. Shft-F9      2    27    92  Alt--        2    27   130
  1920. Shft-F10     2    27    93  Alt-=        2    27   131
  1921. Ctrl-F1      2    27    94  Ctrl-PgUp    2    27   132
  1922. Ctrl-F2      2    27    95  Ctrl-A       2     0     1
  1923. Ctrl-F3      2    27    96  Ctrl-B       2     0     2
  1924. Ctrl-F4      2    27    97  Ctrl-C       2     0     3
  1925. Ctrl-F5      2    27    98  Ctrl-D       2     0     4
  1926. Ctrl-F6      2    27    99  Ctrl-E       2     0     5
  1927. Ctrl-F7      2    27   100  Ctrl-F       2     0     6
  1928. Ctrl-F8      2    27   101  Ctrl-G       2     0     7
  1929. Ctrl-F9      2    27   102  Ctrl-H       2     0     8
  1930. Ctrl-F10     2    27   103  Ctrl-I       2     0     9
  1931. Alt-F1       2    27   104  Ctrl-J       2     0    10
  1932. Alt-F2       2    27   105  Ctrl-K       2     0    11
  1933. Alt-F3       2    27   106  Ctrl-L       2     0    12
  1934. Alt-F4       2    27   107  Ctrl-M       2     0    13
  1935. Alt-F5       2    27   108  Ctrl-N       2     0    14
  1936. Alt-F6       2    27   109  Ctrl-O       2     0    15
  1937. Alt-F7       2    27   110  Ctrl-P       2     0    16
  1938. Alt-F8       2    27   111  Ctrl-Q       2     0    17
  1939. Alt-F9       2    27   112  Ctrl-R       2     0    18
  1940. Alt-F10      2    27   113  Ctrl-S       2     0    19
  1941. Ctrl-LArr    2    27   115  Ctrl-T       2     0    20
  1942. Ctrl-RArr    2    27   116  Ctrl-U       2     0    21
  1943. Ctrl-End     2    27   117  Ctrl-V       2     0    22
  1944. Ctrl-PgDn    2    27   118  Ctrl-W       2     0    23
  1945. Ctrl-Home    2    27   119  Ctrl-X       2     0    24
  1946. ..page
  1947. Key
  1948. Pressed   Ch[0] Ch[1] Ch[2]
  1949. --------- ----- ----- -----
  1950. Ctrl-Y       2     0    25
  1951. Ctrl-Z       2     0    26
  1952. Ctrl-[       2     0    27
  1953. Ctrl-\       2     0    28
  1954. Ctrl-]       2     0    29
  1955. Ctrl-6       2     0    30
  1956. Ctrl--       2     0    31
  1957. ..page
  1958. ..pgno01
  1959. ..head03R
  1960. ..head04CKEYBOARD ELEMENT CODES
  1961. ..head05L_______________________________________________________
  1962. ..foot48RC-##
  1963. This appendix lists the element codes for all the key
  1964. combinations for the entire keyboard, as they are seen
  1965. by the procedures WAITMSG and EDITST.  All keys are
  1966. turned into an integer element code.
  1967.  
  1968. The Global type definition required for this table is:
  1969.  
  1970.     TSet = Set of 0..255;
  1971.  
  1972. The unit or element number in the set defines which key
  1973. or key combination was pressed.  This table was created
  1974. for use as the Terminating Character Set with the
  1975. procedures WAITMSG and EDITST.
  1976.  
  1977. For example if you were to use the procedure WAITMSG
  1978. and you wanted either the Esc or Enter keys to termi-
  1979. nate the procedure the following call to WAITMSG could
  1980. be used:
  1981.  
  1982.    WaitMsg(1,1,'Message here',[1,13],TC);
  1983.  
  1984. ** The element number for the ESC key is 1.
  1985. ** The element number for the ENTER key is 13.
  1986.  
  1987. ** Use the value in the column ELEMENT NUMBER to
  1988. ** determine the element number of the terminating
  1989. ** keys.
  1990.  
  1991. This procedure would then display the message and would
  1992. wait until either the ESC or ENTER key was pressed
  1993. before continuing.
  1994. ..page
  1995. ..head03R
  1996. ..head04R
  1997. ..head05L
  1998.                    Element                    Element
  1999. Key code   AH   AL Number   Key code   AH  AL Number
  2000. --------- ---  --- -------  --------- --- --- -------
  2001. Ctrl-Break  0    0    0     Alt-K      37   0    37
  2002. Esc         1   27    1     Alt-L      38   0    38
  2003.                       2                          39
  2004. Ctrl-2      3    0    3                          40
  2005.                       4                          41
  2006.                       5                          42
  2007.                       6                          43
  2008.                       7     Alt-Z      44   0    44
  2009. BackSp     14    8    8     Alt-X      45   0    45
  2010. Tab        15    9    9     Alt-C      46   0    46
  2011. Ctrl-Enter 28   10   10     Alt-V      47   0    47
  2012.                      11     Alt-B      48   0    48
  2013.                      12     Alt-N      49   0    49
  2014. Enter      28   13   13     Alt-M      50   0    50
  2015. Ctrl-BS    14  127   14                          51
  2016. Shft-Tab   15    0   15                          52
  2017. Alt-Q      16    0   16                          53
  2018. Alt-W      17    0   17                          54
  2019. Alt-E      18    0   18                          55
  2020. Alt-R      19    0   19                          56
  2021. Alt-T      20    0   20                          57
  2022. Alt-Y      21    0   21                          58
  2023. Alt-U      22    0   22     F1         59   0    59
  2024. Alt-I      23    0   23     F2         60   0    60
  2025. Alt-O      24    0   24     F3         61   0    61
  2026. Alt-P      25    0   25     F4         62   0    62
  2027.                      26     F5         63   0    63
  2028.                      27     F6         64   0    64
  2029.                      28     F7         65   0    65
  2030.                      29     F8         66   0    66
  2031. Alt-A      30    0   30     F9         67   0    67
  2032. Alt-S      31    0   31     F10        68   0    68
  2033. Alt-D      32    0   32                          69
  2034. Alt-F      33    0   33                          70
  2035. Alt-G      34    0   34     Home       71   0    71
  2036. Alt-H      35    0   35     UArr       72   0    72
  2037. Alt-J      36    0   36     PgUp       73   0    73
  2038. ..page
  2039.                    Element                    Element
  2040. Key code   AH   AL Number   Key code   AH  AL Number
  2041. --------- ---  --- -------  --------- --- --- -------
  2042.                       74    Alt-F8    111   0   111
  2043. LArr       75    0    75    Alt-F9    112   0   112
  2044.                       76    Alt-F10   113   0   113
  2045. RArr       77    0    77                        114
  2046.                       78    Ctrl-LArr 115   0   115
  2047. End        79    0    79    Ctrl-RArr 116   0   116
  2048. DArr       80    0    80    Ctrl-End  117   0   117
  2049. PgDn       81    0    81    Ctrl-PgDn 118   0   118
  2050. Ins        82    0    82    Ctrl-Home 119   0   119
  2051. Del        83    0    83    Alt-1     120   0   120
  2052. Shft-F1    84    0    84    Alt-2     121   0   121
  2053. Shft-F2    85    0    85    Alt-3     122   0   122
  2054. Shft-F3    86    0    86    Alt-4     123   0   123
  2055. Shft-F4    87    0    87    Alt-5     124   0   124
  2056. Shft-F5    88    0    88    Alt-6     125   0   125
  2057. Shft-F6    89    0    89    Alt-7     126   0   126
  2058. Shft-F7    90    0    90    Alt-8     127   0   127
  2059. Shft-F8    91    0    91    Alt-9     128   0   128
  2060. Shft-F9    92    0    92    Alt-0     129   0   129
  2061. Shft-F10   93    0    93    Alt--     130   0   130
  2062. Ctrl-F1    94    0    94    Alt-=     131   0   131
  2063. Ctrl-F2    95    0    95    Ctrl-PgUp 132   0   132
  2064. Ctrl-F3    96    0    96
  2065. Ctrl-F4    97    0    97
  2066. Ctrl-F5    98    0    98
  2067. Ctrl-F6    99    0    99
  2068. Ctrl-F7   100    0   100
  2069. Ctrl-F8   101    0   101
  2070. Ctrl-F9   102    0   102
  2071. Ctrl-F10  103    0   103
  2072. Alt-F1    104    0   104
  2073. Alt-F2    105    0   105
  2074. Alt-F3    106    0   106
  2075. Alt-F4    107    0   107
  2076. Alt-F5    108    0   108
  2077. Alt-F6    109    0   109
  2078. Alt-F7    110    0   110
  2079. ..page
  2080.           AL+      Element            AL+     Element
  2081. Key code  132   AL Number   Key code  132  AL Number
  2082. --------- ---  --- -------  --------- --- --- -------
  2083. Ctrl-A    133    1   133    &         170  38    170
  2084. Ctrl-B    134    2   134    '         171  39    171
  2085. Ctrl-C    135    3   135    (         172  40    172
  2086. Ctrl-D    136    4   136    )         173  41    173
  2087. Ctrl-E    137    5   137    *         174  42    174
  2088. Ctrl-F    138    6   138    +         175  43    175
  2089. Ctrl-G    139    7   139    ,         176  44    176
  2090. Ctrl-H    140    8   140    -         177  45    177
  2091. Ctrl-I    141    9   141    .         178  46    178
  2092. Ctrl-J    142   10   142    /         179  47    179
  2093. Ctrl-K    143   11   143    0         180  48    180
  2094. Ctrl-L    144   12   144    1         181  49    181
  2095. Ctrl-M    145   13   145    2         182  50    182
  2096. Ctrl-N    146   14   146    3         183  51    183
  2097. Ctrl-O    147   15   147    4         184  52    184
  2098. Ctrl-P    148   16   148    5         185  53    185
  2099. Ctrl-Q    149   17   149    6         186  54    186
  2100. Ctrl-R    150   18   150    7         187  55    187
  2101. Ctrl-S    151   19   151    8         188  56    188
  2102. Ctrl-T    152   20   152    9         189  57    189
  2103. Ctrl-U    153   21   153    :         190  58    190
  2104. Ctrl-V    154   22   154    ;         191  59    191
  2105. Ctrl-W    155   23   155    <         192  60    192
  2106. Ctrl-X    156   24   156    =         193  61    193
  2107. Ctrl-Y    157   25   157    >         194  62    194
  2108. Ctrl-Z    158   26   158    ?         195  63    195
  2109. Ctrl-[    159   27   159    @         196  64    196
  2110. Ctrl-\    160   28   160    A         197  65    197
  2111. Ctrl-]    161   29   161    B         198  66    198
  2112. Ctrl-6    162   30   162    C         199  67    199
  2113. Ctrl--    163   31   163    D         200  68    200
  2114. (space)   164   32   164    E         201  69    201
  2115. !         165   33   165    F         202  70    202
  2116. "         166   34   166    G         203  71    203
  2117. #         167   35   167    H         204  72    204
  2118. $         168   36   168    I         205  73    205
  2119. %         169   37   169    J         206  74    206
  2120. ..page
  2121.           AL+      Element            AL+     Element
  2122. Key code  132   AL Number   Key code  132  AL Number
  2123. --------- ---  --- -------  --------- --- --- -------
  2124. K         207   75   207    p         244 112    244
  2125. L         208   76   208    q         245 113    245
  2126. M         209   77   209    r         246 114    246
  2127. N         210   78   210    s         247 115    247
  2128. O         211   79   211    t         248 116    248
  2129. P         212   80   212    u         249 117    249
  2130. Q         213   81   213    v         250 118    250
  2131. R         214   82   214    w         251 119    251
  2132. S         215   83   215    x         252 120    252
  2133. T         216   84   216    y         253 121    253
  2134. U         217   85   217    z         254 122    254
  2135. V         218   86   218    {         255 123    255
  2136. W         219   87   219
  2137. X         220   88   220
  2138. Y         221   89   221
  2139. Z         222   90   222
  2140. [         223   91   223
  2141. \         224   92   224
  2142. ]         225   93   225
  2143. ^         226   94   226
  2144. _         227   95   227
  2145. `         228   96   228
  2146. a         229   97   229
  2147. b         230   98   230
  2148. c         231   99   231
  2149. d         232  100   232
  2150. e         233  101   233
  2151. f         234  102   234
  2152. g         235  103   235
  2153. h         236  104   236
  2154. i         237  105   237
  2155. j         238  106   238
  2156. k         239  107   239
  2157. l         240  108   240
  2158. m         241  109   241
  2159. n         242  110   242
  2160. o         243  111   243
  2161. ..page
  2162. ..pgno01
  2163. ..head03R
  2164. ..head04CKEYBOARD CODES
  2165. ..head05L_______________________________________________________
  2166. ..foot48RD-##
  2167. This appendix lists the keyboard codes that are
  2168. returned by the computer system when a key or key
  2169. combination is pressed.
  2170.  
  2171. The column headings AH and AL refer to the hi and lo
  2172. registers within the AX register.
  2173.  
  2174. These are the actual values returned by the BIOS inter-
  2175. rupt 16H in assemlby language.
  2176. ..page
  2177. ..head03R
  2178. ..head04R
  2179. ..head05L
  2180. Key                         Key
  2181. Pressed    AH    AL         Pressed    AH    AL
  2182. --------- ----- -----       --------- ----- -----
  2183. (space)     57    32        E           18    69
  2184. !            2    33        F           33    70
  2185. "           40    34        G           34    71
  2186. #            4    35        H           35    72
  2187. $            5    36        I           23    73
  2188. %            6    37        J           36    74
  2189. &            8    38        K           37    75
  2190. '           40    39        L           38    76
  2191. (           10    40        M           50    77
  2192. )           11    41        N           49    78
  2193. *            9    42        O           24    79
  2194. +           13    43        P           25    80
  2195. ,           51    44        Q           16    81
  2196. -           12    45        R           19    82
  2197. .           52    46        S           31    83
  2198. /           53    47        T           20    84
  2199. 0           11    48        U           22    85
  2200. 1            2    49        V           47    86
  2201. 2            3    50        W           17    87
  2202. 3            4    51        X           48    88
  2203. 4            5    52        Y           21    89
  2204. 5            6    53        Z           44    90
  2205. 6            7    54        [           26    91
  2206. 7            8    55        \           43    92
  2207. 8            9    56        ]           27    93
  2208. 9           10    57        ^            7    94
  2209. :           39    58        _           12    95
  2210. ;           39    59        `           41    96
  2211. <           51    60        a           30    97
  2212. =           13    61        b           48    98
  2213. >           52    62        c           46    99
  2214. ?           53    63        d           32   100
  2215. @            3    64        e           18   101
  2216. A           30    65        f           33   102
  2217. B           48    66        g           34   103
  2218. C           46    67        h           35   104
  2219. D           32    68        i           23   105
  2220. ..page
  2221. Key                         Key
  2222. Pressed    AH    AL         Pressed    AH    AL
  2223. --------- ----- -----       --------- ----- -----
  2224. j           36   106        Esc          1    27
  2225. k           37   107        Alt-A       30     0
  2226. l           38   108        Alt-S       31     0
  2227. m           50   109        Alt-D       32     0
  2228. n           49   110        Alt-F       33     0
  2229. o           24   111        Alt-G       34     0
  2230. p           25   112        Alt-H       35     0
  2231. q           16   113        Alt-J       36     0
  2232. r           19   114        Alt-K       37     0
  2233. s           31   115        Alt-L       38     0
  2234. t           20   116        Alt-Z       44     0
  2235. u           22   117        Alt-X       45     0
  2236. v           47   118        Alt-C       46     0
  2237. w           17   119        Alt-V       47     0
  2238. x           48   120        Alt-B       48     0
  2239. y           21   121        Alt-N       49     0
  2240. z           44   122        Alt-M       50     0
  2241. {           26   123        F1          59     0
  2242. |           43   124        F2          60     0
  2243. }           27   125        F3          61     0
  2244. ~           41   126        F4          62     0
  2245. Ctrl-2       3     0        F5          63     0
  2246. BackSp      14     8        F6          64     0
  2247. Tab         15     9        F7          65     0
  2248. Ctrl-Enter  28    10        F8          66     0
  2249. Enter       28    13        F9          67     0
  2250. Shft-Tab    15     0        F10         68     0
  2251. Alt-Q       16     0        Home        71     0
  2252. Alt-W       17     0        UArr        72     0
  2253. Alt-E       18     0        PgUp        73     0
  2254. Alt-R       19     0        LArr        75     0
  2255. Alt-T       20     0        RArr        77     0
  2256. Alt-Y       21     0        End         79     0
  2257. Alt-U       22     0        DArr        80     0
  2258. Alt-I       23     0        PgDn        81     0
  2259. Alt-O       24     0        Ins         82     0
  2260. Alt-P       25     0        Del         83     0
  2261. ..page
  2262. Key                         Key
  2263. Pressed    AH    AL         Pressed    AH    AL
  2264. --------- ----- -----       --------- ----- -----
  2265. Shft-F1     84     0        Alt-3      122     0
  2266. Shft-F2     85     0        Alt-4      123     0
  2267. Shft-F3     86     0        Alt-5      124     0
  2268. Shft-F4     87     0        Alt-6      125     0
  2269. Shft-F5     88     0        Alt-7      126     0
  2270. Shft-F6     89     0        Alt-8      127     0
  2271. Shft-F7     90     0        Alt-9      128     0
  2272. Shft-F8     91     0        Alt-0      129     0
  2273. Shft-F9     92     0        Alt--      130     0
  2274. Shft-F10    93     0        Alt-=      131     0
  2275. Ctrl-F1     94     0        Ctrl-PgUp  132     0
  2276. Ctrl-F2     95     0        Ctrl-A      30     1
  2277. Ctrl-F3     96     0        Ctrl-B      48     2
  2278. Ctrl-F4     97     0        Ctrl-C      46     3
  2279. Ctrl-F5     98     0        Ctrl-D      32     4
  2280. Ctrl-F6     99     0        Ctrl-E      18     5
  2281. Ctrl-F7    100     0        Ctrl-F      33     6
  2282. Ctrl-F8    101     0        Ctrl-G      34     7
  2283. Ctrl-F9    102     0        Ctrl-H      35     8
  2284. Ctrl-F10   103     0        Ctrl-I      23     9
  2285. Alt-F1     104     0        Ctrl-J      36    10
  2286. Alt-F2     105     0        Ctrl-K      37    11
  2287. Alt-F3     106     0        Ctrl-L      38    12
  2288. Alt-F4     107     0        Ctrl-M      50    13
  2289. Alt-F5     108     0        Ctrl-N      49    14
  2290. Alt-F6     109     0        Ctrl-O      24    15
  2291. Alt-F7     110     0        Ctrl-P      25    16
  2292. Alt-F8     111     0        Ctrl-Q      16    17
  2293. Alt-F9     112     0        Ctrl-R      19    18
  2294. Alt-F10    113     0        Ctrl-S      31    19
  2295. Ctrl-LArr  115     0        Ctrl-T      20    20
  2296. Ctrl-RArr  116     0        Ctrl-U      22    21
  2297. Ctrl-End   117     0        Ctrl-V      47    22
  2298. Ctrl-PgDn  118     0        Ctrl-W      17    23
  2299. Ctrl-Home  119     0        Ctrl-X      48    24
  2300. Alt-1      120     0        Ctrl-Y      21    25
  2301. Alt-2      121     0        Ctrl-Z      44    26
  2302. ..page
  2303. Key
  2304. Pressed    AH    AL
  2305. --------- ----- -----
  2306. Ctrl-[      26    27
  2307. Ctrl-\      43    28
  2308. Ctrl-]      27    29
  2309. Ctrl-6       7    30
  2310. Ctrl--      12    31
  2311. Ctrl-BS     14   127
  2312. Ctrl-Break   0     0
  2313. ..page
  2314. ..pgno01
  2315. ..head03R
  2316. ..head04CKEYBOARD SCAN CODES
  2317. ..head05L_______________________________________________________
  2318. ..foot48RE-##
  2319.                      FUNCTION KEYS
  2320.  
  2321.          Scan |      Scan |      Scan |      Scan |
  2322.     Key  Code | Key  Code | Key  Code | Key  Code |
  2323.     ---  ---- | ---  ---- | ---  ---- | ---  ---- |
  2324.      F1    59 |  F4    62 |  F7    65 | F10   68  |
  2325.      F2    60 |  F5    63 |  F8    66 |           |
  2326.      F3    61 |  F6    64 |  F9    67 |           |
  2327.  
  2328.  
  2329.                     NUMERIC KEYPAD
  2330.  
  2331.          Scan |      Scan |      Scan |      Scan |
  2332.     Key  Code | Key  Code | Key  Code | Key  Code |
  2333.     ---  ---- | ---  ---- | ---  ---- | ---  ---- |
  2334.      7    71  |  4    76  |  1    79  |  .    83  |
  2335.      8    72  |  5    76  |  2    80  |           |
  2336.      9    73  |  6    77  |  3    81  |           |
  2337.      -    74  |  +    78  |  0    82  |           |
  2338.  
  2339.  
  2340.                      CONTROL KEYS
  2341.  
  2342.                       Scan |              Scan
  2343.          Key          Code | Key          Code
  2344.          ---          ---- | ---          ----
  2345.          Esc            1  | Ctrl          29
  2346.          Backspace     14  | Left Shft     42
  2347.          Num Lock      69  | Right Shft    54
  2348.          Scroll Lock   70  | Alt           56
  2349.          Tab           15  | Caps Lock     58
  2350.          Enter         28  |
  2351. ..page
  2352. ..head03R
  2353. ..head04R
  2354. ..head05L
  2355.          LETTER, NUMBER, AND PUNCTUATION KEYS
  2356.  
  2357.         Scan |      Scan |      Scan |         Scan
  2358.    Key  Code | Key  Code | Key  Code | Key     Code
  2359.    ---  ---- | ---  ---- | ---  ---- | ---     ----
  2360.     1     2  |  W    17  |  D    32  |  C       46
  2361.     2     3  |  E    18  |  F    33  |  V       47
  2362.     3     4  |  R    19  |  G    34  |  B       48
  2363.     4     5  |  T    20  |  H    35  |  N       49
  2364.     5     6  |  Y    21  |  J    36  |  M       50
  2365.     6     7  |  U    22  |  K    37  |  ,       51
  2366.     7     8  |  I    23  |  L    38  |  .       52
  2367.     8     9  |  O    24  |  ;    39  |  /       53
  2368.     9    10  |  P    25  |  '    40  |  (PrtSc) 55
  2369.     0    11  |  [    26  |  `    41  |  (Space) 57
  2370.     -    12  |  ]    27  |  \    43  |
  2371.     =    13  |  A    30  |  Z    44  |
  2372.     Q    16  |  S    31  |  X    45  |
  2373. ..page
  2374.